package com.crm.controller;

import com.crm.common.result.ResultVO;
import com.crm.common.result.TableDataInfo;
import com.crm.entity.ClueFollow;
import com.crm.service.ClueFollowService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * \* User: chy
 * \* Date: 2025/9/4  下午8:44
 * \* Description:线索跟进
 * \
 */
@RestController
@RequestMapping("/clues/record")
@Slf4j
public class ClueFollowController {
    @Autowired
    private ClueFollowService clueFollowService;

    /**
     * 添加线索跟进信息
     *
     * @param clueFollow
     * @return
     */
    @PostMapping
    public ResultVO save(@RequestBody ClueFollow clueFollow) {
        log.info("添加线索跟进：{}", clueFollow);
        clueFollowService.saveClueFollow(clueFollow);
        return ResultVO.success();
    }
    /**
     * 查询线索跟进信息
     *
     * @param clueId
     * @return
     */
    @GetMapping("/list")
    public TableDataInfo<ClueFollow> listByClueId(Long clueId) {
        log.info("查询线索跟进：{}", clueId);
        List<ClueFollow> clueFollows = clueFollowService.listByClueId(clueId);
        return TableDataInfo.success(clueFollows);
    }
}
